﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LynxWiki.DomainModel
{
    public class TagCloud
    {
        public Dictionary<string, int> TagCount { get; set; }

        public TagCloud(Dictionary<string, int> _tagCloud)
        {
            TagCount = _tagCloud;
        }

        public string GetRankForTag(int tagCount)
        {
            string result = "tag0";

            switch (tagCount)
            {
                case 0:
                    result = "tag0";
                    break;
                case 1:
                case 2:
                case 3:
                case 4:
                    result = "tag1";
                    break;
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                    result = "tag2";
                    break;
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                    result = "tag3";
                    break;
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 26:
                    result = "tag4";
                    break;
                case 27:
                case 28:
                case 29:
                case 30:
                case 31:
                case 32:
                case 33:
                case 34:
                case 35:
                case 36:
                    result = "tag5";
                    break;
                case 37:
                case 38:
                case 39:
                case 40:
                case 41:
                case 42:
                case 43:
                case 44:
                case 45:
                case 46:
                case 47:
                case 48:
                case 49:
                    result = "tag6";
                    break;
                default:
                    result = "tag7";
                    break;
            }

            return result;
        }
    }
}
